<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        //1.检测获取字符串长度 length
        var str = '演示文本';
        console.log(str.length); //4
        // 2.字符串拼接 +
        console.log('沙漠'+'骆驼'); //字符串 沙漠骆驼
        console.log('演示本文'+20); //演示文本20
        console.log('pink'+true);//pinktrue
        console.log(12+12);//24
        console.log('12'+12);//1212
        // 3.字符串拼接加强
        console.log('演示文本'+20+'文本');
        var age = 18;
        console.log('演示文本' + age + '文本');
    </script>
</head>
<body>
    
</body>
</html>